package com.qiezzi.eggplant.util;

import android.graphics.Bitmap;

import java.io.ByteArrayOutputStream;

/**
 * Created by Administrator on 2015/7/31 0031.
 */
public class Bitmap_base {

    /**
     * 将bitmap转化成字符串String
     *
     * @param bitmap
     * @return
     */
    public static String bitmapToString(Bitmap bitmap) {

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.JPEG, 60, baos);
        byte[] b = baos.toByteArray();
        return android.util.Base64.encodeToString(b, android.util.Base64.DEFAULT);

    }
}
